package com.itgaohe.common;

import lombok.Data;

/**
 * @Classname R
 * @Description
 * @Date 2025/3/19 14:38
 * @Created by 张队
 */
@Data
public class R {
    //    状态码
    public  Integer code;
    //    数据内容
    public Object data;
    //    错误信息
    public String msg;
    public  static R success(Object o){
        R r = new R();
        r.setCode(200);
        r.setData(o);
        r.setMsg(null);
        return r;
    }
    public  static R error(String msg){
        R r = new R();
        r.setCode(500);
        r.setData(null);
        r.setMsg(msg);
        return r;
    }
}